e2bc626ba3df52035fb08386f204ab06560ba084,modules/core/portal-lpkg-deployer/src/main/java/com/liferay/portal/lpkg/deployer/internal/LPKGDeployerImpl.java,LPKGDeployerImpl,deploy,#BundleContext#File#,132

Before Change


	public List<Bundle> deploy(BundleContext bundleContext, File lpkgFile)
		throws IOException {

		String canonicalPath = lpkgFile.getCanonicalPath();

		for (Bundle bundle : _lpkgVerifier.verify(lpkgFile)) {
			try {

After Change



				String location = bundle.getLocation();

				if (!location.equals(lpkgFile.getCanonicalPath()) &&
					Files.deleteIfExists(Paths.get(bundle.getLocation())) &&
					_log.isInfoEnabled()) {

					_log.info("Removed old lpkg file " + bundle.getLocation());
				}
			}
			catch (BundleException be) {
				_log.error(
					"Unable to uninstall " + bundle + " for " + lpkgFile, be);
			}
		}

		try {
			List<Bundle> bundles = new ArrayList<>();

			Bundle lpkgBundle = bundleContext.installBundle(
				lpkgFile.getCanonicalPath(), _lpkgToOSGiBundle(lpkgFile));

			BundleStartLevel bundleStartLevel = lpkgBundle.adapt(
				BundleStartLevel.class);